#include <Reg51.h>
#include "delay.h"
#include "LCD1602.h"
#include <string.h>

void main()
{
	unsigned char i;
	unsigned char str1[] = "Hello LCD 1602";
	unsigned char str2[] = "Welcome to study LCD1602";
	LCDInit();
	DelayXms(10);
	LCDWriteCmd(LCD_DIS_MODE_LEFT);//初始设置的字符输入模式 整屏左移
	LCDWriteCmd(0x80);
	for (i = 0; i < strlen(str1); i++)
	{
		LCDWriteData(str1[i]);
		//DelayXms(400);
	}

	LCDWriteCmd(0xC0);
	for (i = 0; i < strlen(str2); i++)
	{
		LCDWriteData(str2[i]);
		//DelayXms(400);
		}
	while(1)
	{
		LCDWriteCmd(0x1C);//右移  0x18 左移
		DelayXms(500);
	}
	
	
}

